Repository navigation
Pyjo.Headers: shortcuts of the headers of security and of CORS - #635
Merged
Merged
Conversation
Permissions-Policy, Content-Security-Policy-Report-Only, Reporting-Endpoints, X-Content-Type-Options, Referrer-Policy, the Cross-Origin-*-Policy headers and the headers of CORS other than Access-Control-Allow-Origin, with their names in NAMES, so that they keep their normal case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Docker Smoke Test
|
Contributor
Tests
|
6 of 7 tasks
7 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #634, its first step: the bottom of a stack of pull requests, which the next steps (the plugin of the security headers, the nonce, the reports of CSP, CORS) build on.
Changes
Pyjo.Headers, each with a# Not in Mojolicious:marker, a docstring example and the specification it comes from:permissions_policy,content_security_policy_report_only,reporting_endpointsx_content_type_options,referrer_policycross_origin_embedder_policy,cross_origin_opener_policy,cross_origin_resource_policyaccess_control_allow_credentials,access_control_allow_headers,access_control_allow_methods,access_control_expose_headers,access_control_max_age,access_control_request_headers,access_control_request_methodNAMES, so a header added in lower case keeps its normal case innames()and in the message.Validation
t/Pyjo/Headers.py: every new shortcut, the normal case of the names, and the name ofContent-Security-Policy-Report-Onlyin the messaget/docs/Headers.pyevaluates the docstring example of each shortcutPYTHONDEVMODE=1 python -m Pyjo.Prove -l -j 4 -r t: all tests passsphinx-build -Wpasses and the API page lists the new shortcutstrunk check: no issues🤖 Generated with Claude Code